class City < ActiveRecord::Base
  has_many :clients
  
  validates_presence_of :name
  validates_length_of :name, :maximum => 100
  
  validates_presence_of :state
  validates_inclusion_of :state, :in => STATES
  before_validation :capitalize_state
  
  def capitalize_state
    self.state = self.state.upcase unless self.state.nil?
  end
end
